package com.bobo.base.network.base;

import java.io.Serializable;

/**
 *{
 *    "code": 200,
 *    "msg": null,
 *    "result": {
 *       "message": "OK",
 *       "code": "OK",
 *       "requestId": "86B88B9E-C057-4A08-9F68-528995CA963C",
 *       "bizId": "732718004650084802^0"
 *    }
 * }
 */
public class BasicResponse<T> implements Serializable {

    private int code;
    private long timestamp;
    private String msg;
    private T data;

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }



    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }


    public boolean isOk() {
        return getCode() == 0;
    }

    public boolean checkStatus() {
        return getCode() == 200;
    }
}
